"""
1.函数用例前后置
2.测试类中前后置
3.模块中的前后置
"""
import pytest
from random import randint


# def random_num():
#     return randint(1, 10)
#
#
# class TestPy:
#     # 不可以有__init__（）方法
#
#     def test_in_class_1(self):
#         assert random_num() == 3
#
#     def test_in_class_2(self):
#         assert random_num() == 4


# 1.函数用例前后置
# 前置：setup_function
# 后置：teardown_function

def setup_function(function):
    print("函数用例前置方法执行")

def teardown_function(function):
    print("函数用例后置方法执行")

def test_01():
    print("--------用例方法01----------")


pytest.main(["--alluredir=reports"])
